package com.yangjun.controller.report;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yangjun.service.report.TargetMemberReprotExportService;
import com.yangjun.vo.report.TargetMemberReportExportVO;

@RestController
@RequestMapping(value="/excel/tarMember")
public class TargetMemberController {
	@Autowired
	private TargetMemberReprotExportService targetMemberReprotExportService;
	
	@ResponseBody
	@RequestMapping("/getDeminsion")
	public Object getDeminsion(@RequestParam(value="reportid")String reportid,@RequestParam(value="userid")String userid){
		return targetMemberReprotExportService.getDeminsion(reportid,userid);
	}
	@ResponseBody
	@RequestMapping("/queryDataByReportId")
	public Object queryDataByReportid(@RequestParam(value="reportid")String reportid){
		return targetMemberReprotExportService.queryData(reportid);
	}
	@ResponseBody
	@RequestMapping("/queryData")
	public Object queryData(TargetMemberReportExportVO tmreVo){
		return targetMemberReprotExportService.queryData(tmreVo);
	}
	
	@ResponseBody
	@RequestMapping("/addReport")
	public Object addReport(TargetMemberReportExportVO tmreVo){
		return targetMemberReprotExportService.addOrUpdateReport(tmreVo);
	}
	
	
	@ResponseBody
	@RequestMapping("/addDownloadTaskByReportId")
	public Object addDownloadTaskByReportId(@RequestParam(value="reportid")String reportid,HttpServletRequest request){
		return targetMemberReprotExportService.addDownloadTask(reportid,request);
	}	
	
	@ResponseBody
	@RequestMapping("/addDownloadTask")
	public Object addDownloadTask(TargetMemberReportExportVO tmreVo,HttpServletRequest request){
		return targetMemberReprotExportService.addDownloadTask(tmreVo,request); 
	}
}
